/**
 * Copyright &copy; 2012-2013 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package cn.conac.rc.framework.entity;

import java.io.Serializable;

import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.PrePersist;

import cn.conac.rc.framework.utils.IdGen;
import io.swagger.annotations.ApiModelProperty;

/**
 * Entity支持类
 * @param <T> 泛型对象
 * @author ThinkGem
 * @version 2013-01-15
 */
@MappedSuperclass
public abstract class BaseEntity<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @ApiModelProperty("主键id")
    @Id
    protected Integer id;

    public BaseEntity() {
    }

//    /**
//     * prePersist.
//     */
//    @PrePersist
//    public void prePersist() {
//        this.id = IdGen.uuid();
//    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

}
